const  getParentIdList=(data2:any, nodeId2:number)=> {
    var arrRes:any = [];
    if (data2.length === 0) {
        if (nodeId2) {
            arrRes.unshift({ id: data2.id, name: data2.name });
        }
        return arrRes;
    }
    let rev = (data:any, nodeId:number) => {
        for (var i = 0, length = data.length; i < length; i++) {
            let node = data[i];
            if (node.id === nodeId) {
                arrRes.unshift({ id: node.id, name: node.name });
                rev(data2, node.pid);
                break;
            } else {
                if (node.children) {
                    rev(node.children, nodeId);
                }
            }
        }
        return arrRes;
    };
    arrRes = rev(data2, nodeId2);
    return arrRes.map((item:any)=>item.id);
}
export {getParentIdList}